import React from 'react'
import styles from './css/query.module.css'
import { useNavigate, useSearchParams } from 'react-router-dom';

function tem(props) {
    console.log(props);
    let nav=useNavigate()
    let [sp]=useSearchParams()
  return (
    <div className={styles.box} onClick={()=>nav(`/ticket:id?id=${props.children.id}&start=${props.children.startStation}&end=${props.children.endStation}&date=${sp.get('date')}`)} >
      <div className={styles.ttop}>
      <span>{props.children.startTime}</span>
      <span>{props.children.timeTaken}</span>
      <span>{props.children.endTime}</span>
      <span style={{color:'red'}}> ￥{props.children.ssoftSeat.price}</span>
      </div>
      <div className={styles.tcenter}>
        <span>{props.children.startStation}</span>
        <span>{props.children.trainNo}</span>
        <span>{props.children.endStation}</span>
      </div>

      <div className={styles.tunder}>
        <span>二等 {props.children.ssoftSeat.ticketNum}</span>
        <span>一等 {props.children.fsoftSeat.ticketNum}</span>
        <span>商务 ({props.children.businessSeat.ticketNum})张</span>
      </div>
    </div>
  )
}

export default tem
